﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.WmsManagement;

namespace Digitalmes.Model.WmsManagement
{
    /// <summary>
    /// 物料仓库
    /// </summary>
	[Table("MaterialStore")]

    [Display(Name = "_Model.MaterialStore")]
    public class MaterialStore : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._MaterialStore._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._MaterialStore._MinStore")]
        [Comment("最低库存")]
        [Precision(18,2)]
        public decimal? MinStore { get; set; }
        [Display(Name = "_Model._MaterialStore._StoreQty")]
        [Comment("当前在库")]
        [Precision(18,2)]
        public decimal? StoreQty { get; set; }
        [Display(Name = "_Model._MaterialStore._MaxStore")]
        [Comment("最高库存")]
        [Precision(18,2)]
        public decimal? MaxStore { get; set; }
        [Display(Name = "_Model._MaterialStore._LastInBatch")]
        [Comment("最近入库批次")]
        public string LastInBatch { get; set; }
        [Display(Name = "_Model._MaterialStore._LastInStoreTime")]
        [Comment("最近入库时间")]
        public DateTime? LastInStoreTime { get; set; }
        [Display(Name = "_Model._MaterialStore._LastOutStoreTime")]
        [Comment("最近出库时间")]
        public decimal? LastOutStoreTime { get; set; }
        [Display(Name = "_Model._MaterialStore._Pos")]
        [Comment("存放位置")]
        public string Pos { get; set; }

        [Display(Name = "_Model._Warehouse._Name")]
        public long? WarehouseId { get; set; }

        public Warehouse Warehouse { get; set; }


        [Display(Name = "_Model._MaterialStore._Material")]
        [Comment("物料")]
        public MaterialDoc Material { get; set; }
        [Display(Name = "_Model._MaterialStore._Material")]
        [Comment("物料")]
        public long? MaterialId { get; set; }
        [Display(Name = "_Model._MaterialStore._Expiration")]
        [Comment("保质期")]
        [Precision(18,2)]
        public decimal? Expiration { get; set; }
        [Display(Name = "_Model._MaterialStore._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
